import { useUserStore } from "~~/store/user";
export default defineNuxtRouteMiddleware((to, from) => {
    if (to.path === "/collection") {
        const store = useUserStore()
        if (store.login === false) {
            abortNavigation();
            alert('需要登录')
            if (from.path === "/collection") {
                return navigateTo('/home')
            } else {
                return navigateTo(from.path)
            }
        }
    } else if (to.path === "/playHistory") {
        const store = useUserStore()
        if (store.login === false) {
            abortNavigation();
            alert('需要登录')
            if (from.path === "/playHistory") {
                return navigateTo('/home')
            } else {
                return navigateTo(from.path)
            }
        }
    }
})